<template>
	<view style="min-height: 100vh;overflow: hidden;">
		<view
			style="font-size: 34rpx;display: flex;align-items: center;justify-content: space-between;padding: 12rpx 24rpx;background-color: #FFFFFF;margin: 0 auto;margin-top: 20rpx;width: 702rpx;border-radius: 16rpx;">
			<view>大号字体</view>
			<view style="text-align: right;width: 150rpx;">
				<u-switch v-model="checked1" @change='change1'></u-switch>
			</view>
		</view>
		<view style="position: fixed;bottom: 108rpx;margin-left: 31rpx;">
			<view class="exit_btn" @click="exit">退出登录</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checked1: false,
				checked2: false,
				platform: ''
			};
		},
		onLoad() {
			if (this.$store.state.app.topfontsize == '33') {
				this.checked1 = false
			} else {
				this.checked1 = true
			}
			if (this.$store.state.app.chancefontsize == '38') {
				this.checked2 = false
			} else {
				this.checked2 = true
			}
			// 判断平台
			// #ifdef MP-WEIXIN
			this.platform = 'wx'
			// #endif
			// #ifdef MP-TOUTIAO
			this.platform = 'dy'
			// #endif
			// #ifdef MP-KUAISHOU
			this.platform = 'kuaishou'
			// #endif
		},
		methods: {
			change1(e) {
				let size = 33
				let size2 = 38
				let weigh = '400'
				if (this.platform != 'wx') {
					if (!e) {
						size = 43
						size2 = 48
						weigh = 'bold'
					} else {
						size = 33
						size2 = 38
						weigh = '400'
					}
				} else {
					if (e) {
						size = 43
						size2 = 48
						weigh = 'bold'
					} else {
						size = 33
						size2 = 38
						weigh = '400'
					}
				}

				this.$store.commit('app/settopfontsize', size)
				this.$store.commit('app/setchancefontsize', size2)
				this.$store.commit('app/setweight', weigh)
			},
			//退出登录
			exit() {
				uni.showToast({
					title: '退出登录成功',
					icon: 'none'
				})
				setTimeout(() => {
					uni.removeStorageSync('token')
					this.$store.commit('app/SETUSERINFO', {})
					this.$store.commit('app/setToken', '')
					uni.switchTab({
						url: '/pages/tabbar/home/index'
					})
				}, 600)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bottom_btn {
		width: 702rpx;
		height: 92rpx;
		border-radius: 16rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		background-color: #5758f1;
		margin: 0 auto;
		margin-top: 220rpx;
	}

	.exit_btn {
		width: 688rpx;
		height: 90rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		border: 1rpx solid #2B6BFF;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 30rpx;
		color: #2B6BFF;
	}
</style>